<template>
  <div class="journey-container">
    <div class="journey-content">
      <h1 class="journey-title">我的历程</h1>
      
      <!-- 添加回主页按钮 -->
      <div class="back-home-button">
        <a @click="goToHome" class="action-button">
          <span class="button-content">主页</span>
          <span class="button-glow"></span>
          <span class="button-hover"></span>
        </a>
      </div>

      <!-- 技能树部分 -->
      <div class="skills-section">
        <h2>技能树</h2>
        <div class="skills-grid">
          <div v-for="(skill, index) in skills" :key="index" class="skill-card">
            <div class="skill-icon">{{ skill.icon }}</div>
            <div class="skill-name">{{ skill.name }}</div>
            <div class="skill-level">
              <div class="progress-bar" :style="{ width: skill.level + '%' }"></div>
            </div>
          </div>
        </div>
      </div>

      <!-- 时间线部分 -->
      <div class="timeline-section">
        <h2>成长历程</h2>
        <div class="timeline">
          <div v-for="(event, index) in timelineEvents" :key="index" class="timeline-item">
            <div class="timeline-date">{{ event.date }}</div>
            <div class="timeline-content">
              <h3>{{ event.title }}</h3>
              <p>{{ event.description }}</p>
            </div>
            <div class="timeline-dot"></div>
          </div>
        </div>
      </div>

      <!-- 成就展示部分 -->
      <div class="achievements-section">
        <h2>个人成就</h2>
        <div class="achievements-grid">
          <div v-for="(achievement, index) in achievements" :key="index" class="achievement-card">
            <div class="achievement-icon">{{ achievement.icon }}</div>
            <div class="achievement-title">{{ achievement.title }}</div>
            <div class="achievement-description">{{ achievement.description }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import router from '@/router'

export default {
  name: 'Journey',
  data() {
    return {
      skills: [
        { name: 'Java', level: 90, icon: '⚡' },
        { name: 'Spring Boot', level: 85, icon: '🌱' },
        { name: 'Vue.js', level: 80, icon: '⚛️' },
        { name: 'MySQL', level: 85, icon: '🗄️' },
        { name: 'Linux', level: 75, icon: '🐧' },
        { name: 'Git', level: 80, icon: '📦' }
      ],
      timelineEvents: [
        {
          date: '2023',
          title: '开始学习Java开发',
          description: '系统学习Java编程语言和Spring框架'
        },
        {
          date: '2024',
          title: '全栈开发实践',
          description: '开始学习Vue.js并实践全栈开发'
        },
        {
          date: '2025',
          title: '个人博客项目',
          description: '开发个人博客系统，整合前后端技术'
        }
      ],
      achievements: [
        {
          icon: '🏆',
          title: '技术认证',
          description: '获得Java高级开发工程师认证'
        },
        {
          icon: '🚀',
          title: '项目经验',
          description: '完成多个企业级项目开发'
        },
        {
          icon: '💡',
          title: '创新实践',
          description: '开发创新性解决方案'
        }
      ]
    }
  },
  methods: {
    goToHome() {
      router.push({name: 'Blog'});
    }
  }
}
</script>

<style scoped>
.journey-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem;
  color: #fff;
}

.journey-content {
  max-width: 1200px;
  margin: 0 auto;
}

.journey-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #00fff2;
  text-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

/* 技能树样式 */
.skills-section {
  margin-bottom: 4rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.skill-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
}

.skill-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.skill-name {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.skill-level {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00fff2, #00b4d8);
  border-radius: 3px;
  transition: width 1s ease;
}

/* 时间线样式 */
.timeline-section {
  margin-bottom: 4rem;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: #00fff2;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
  padding-right: 2rem;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-right: 0;
  padding-left: 2rem;
}

.timeline-date {
  font-size: 1.2rem;
  color: #00fff2;
  margin-bottom: 0.5rem;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.timeline-dot {
  position: absolute;
  right: -6px;
  top: 0;
  width: 12px;
  height: 12px;
  background: #00fff2;
  border-radius: 50%;
  box-shadow: 0 0 10px #00fff2;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: auto;
  left: -6px;
}

/* 成就展示样式 */
.achievements-section {
  margin-bottom: 4rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.achievement-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  transition: transform 0.3s ease;
}

.achievement-card:hover {
  transform: translateY(-5px);
}

.achievement-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.achievement-title {
  font-size: 1.3rem;
  color: #00fff2;
  margin-bottom: 0.5rem;
}

.achievement-description {
  color: rgba(255, 255, 255, 0.8);
}

h2 {
  font-size: 2rem;
  color: #00fff2;
  margin-bottom: 2rem;
  text-align: center;
}

@media (max-width: 768px) {
  .timeline::before {
    left: 0;
  }

  .timeline-item {
    width: 100%;
    padding-left: 2rem;
    padding-right: 0;
    margin-left: 0;
  }

  .timeline-item:nth-child(even) {
    margin-left: 0;
    padding-left: 2rem;
  }

  .timeline-dot {
    left: -6px !important;
  }
}

/* 添加回主页按钮样式 */
.back-home-button {
  position: fixed;
  bottom: 40px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.action-button {
  position: relative;
  width: 120px;
  height: 45px;
  background: rgba(4, 177, 255, 0.1);
  border: 1px solid rgba(4, 177, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.button-content {
  color: #04b1ff;
  font-size: 18px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 1;
  transition: all 0.3s ease;
}

.button-glow {
  position: absolute;
  width: 20px;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(4, 177, 255, 0.3),
    transparent
  );
  animation: button-glow 2s linear infinite;
  transform: skewX(-45deg);
}

.button-hover {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: all 0.3s ease;
}

.action-button:hover {
  background: rgba(4, 177, 255, 0.2);
  border-color: #04b1ff;
  transform: translateY(-2px);
}

.action-button:hover .button-content {
  color: white;
  text-shadow: 0 0 10px rgba(4, 177, 255, 0.5);
}

.action-button:hover .button-hover {
  background: linear-gradient(
    45deg,
    transparent,
    rgba(4, 177, 255, 0.1),
    transparent
  );
}

@keyframes button-glow {
  0% {
    transform: translateX(-100%) skewX(-45deg);
  }
  100% {
    transform: translateX(200%) skewX(-45deg);
  }
}

@media (max-width: 768px) {
  .action-button {
    width: 80px;
    height: 30px;
    font-size: 14px;
  }
}
</style> 